import Reflux from "reflux";
import {Message} from "@biz/Components";

export default class Store extends Reflux.Store {
    constructor(props, action) {
        super(props);
        this.state = this.getInitialState();
        this.listenables = action;
        this.props = props;
        this.action = action;
    }

    getInitialState() {
        return {
            loading:false
        };
    }

    onResetPwd(){
        this.setState({loading:true})
    }
    onResetPwdCompleted(res) {
        this.setState({loading:false})
        if (res.success) {
            Message.success("修改成功");
            window.RouterGo(window.CONFIG.PAGE_HOME);
        } else {
            Message.error(res.errMsg);
            this.setState({errMsg: res.errMsg});
        }
    }
}